﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Panel.Master" Inherits="System.Web.Mvc.ViewPage" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	<%=System.Configuration.ConfigurationManager.AppSettings["pageTitle"] %>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

<div class="listHeader">
    <img src="../../Images/ListImages/contentlist.png" alt="" class="listHeaderIco" />
    <div class="listHeaderText">Yazı Yöneticisi : Yeni</div>
    
    <div class="listHeaderMenuBox">
        <% Html.RenderPartial("/views/shared/userControls/acceptance.ascx",
               new Prodma.DataAccess.Models.UserControlViewModels.AcceptanceVm() { View = "content" }); %>
    </div>
</div>

<form method="post" action="/content/new/">
<div class="detailContainer">
    <div class="detailSection-50pc">
        <div class="detailSectionHeader">İçerik Bilgileri</div>
        <div class="detailSectionRow">
            <div class="detailSectionRowTitle-20pc">Adı :</div>
            <div class="detailSectionRowText-80pc"><input type="text" id="name" name="name" maxlength="100" class="detailSectionControl" /></div>
        </div>
        <div class="detailSectionRow">
            <div class="detailSectionRowTitle-20pc">Başlık :</div>
            <div class="detailSectionRowText-80pc"><input type="text" id="title" name="title" maxlength="245" class="detailSectionControl" /></div>
        </div>        
        <div class="detailSectionRow">
            <div class="detailSectionRowTitle-20pc">Özet :</div>
            <div class="detailSectionRowText-80pc"><textarea rows="10" id="description" name="description" onkeypress="return descriptionMaxLength(this, 400);" class="detailSectionControl"></textarea></div>
        </div>
    </div>
    <div class="detailSection-50pc">
        <div class="detailSectionHeader">Sistem Bilgileri</div>
        <div class="detailSectionRow">
            <div class="detailSectionRowTitle-20pc">Durum :</div>
            <div class="detailSectionRowText-80pc"><%=Html.DropDownList("ddlState", (SelectList)ViewData["stateList"], "Seçiniz", new { @class = "detailSectionControlCombo" })%></div>
        </div>
        <div class="detailSectionRow">
            <div class="detailSectionRowTitle-20pc">Kategori :</div>
            <div class="detailSectionRowText-80pc"><%=Html.DropDownList("ddlCategory", (SelectList)ViewData["categoryList"], "Seçiniz", new { @class = "detailSectionControlCombo" })%></div>
        </div>
        <div class="detailSectionRow">
            <div class="detailSectionRowTitle-20pc">Dil :</div>
            <div class="detailSectionRowText-80pc"><%=Html.DropDownList("ddlLanguage", (SelectList)ViewData["languageList"], "Seçiniz", new { @class = "detailSectionControlCombo" })%></div>
        </div>
        <div class="detailSectionRow">
            <div class="detailSectionRowTitle-20pc">Başlangıç Tarihi :</div>
            <div class="detailSectionRowText-80pc"><input type="text" id="sDate" name="sDate" maxlength="10" class="detailSectionControl" /></div>
        </div>
        <div class="detailSectionRow">
            <div class="detailSectionRowTitle-20pc">Bitiş Tarihi :</div>
            <div class="detailSectionRowText-80pc"><input type="text" id="fDate" name="fDate" maxlength="10" class="detailSectionControl" /></div>
        </div>
    </div>
    <div class="detailSection-50pc">
        <div class="detailSectionHeader">Arşiv Bilgileri</div>
        <div class="detailSectionRow">
            <div class="detailSectionRowTitle-20pc">Arşiv :</div>
            <div class="detailSectionRowText-80pc"><%=Html.DropDownList("ddlArchive", (SelectList)ViewData["archiveList"], "Seçiniz", new { @class = "detailSectionControlCombo" })%></div>
        </div>
        <div class="detailSectionRow">
            <div class="detailSectionRowTitle-20pc">Klasör :</div>
            <div class="detailSectionRowText-80pc">
                <input type="text" id="folder" name="folder" maxlength="150" class="detailSectionControl" />
            </div>
        </div>
        <div class="detailSectionRow">
            <div class="detailSectionRowTitle-20pc"></div>
            <div class="detailSectionRowText-80pc">
                <input type="button" id="createFolder" value="Klasörü Oluştur" class="detailSectionControlButton" />
            </div>
        </div>
    </div>
    <div class="detailSection-100pc">
        <div class="detailSectionHeader">Fotoğraf</div>
        <div class="detailSectionRow">
            <div class="detailSectionRowTitle-10pc"></div>
            <div class="detailSectionRowText-90pc"><img src="../../Images/blankcontent.png" alt="" class="detailSectionImage" /></div>
            <div class="detailSectionRowTitle-10pc">Resim Seç :</div>
            <div class="detailSectionRowText-90pc"><iframe src="/content/image/" width="100%" height="25px" frameborder="0" ></iframe></div>
        </div>
    </div>
    <div class="detailSection-100pc">
        <div class="detailSectionHeader">Yazı</div>
        <div class="detailSectionRow">
            <textarea id="content" cols="30" name="content" rows="10" style="width: 100%; height:500px;"></textarea>
        </div>
    </div>
</div>
</form>

<script src="../../tinymce/jscripts/tiny_mce/tiny_mce.js" type="text/javascript"></script>
<script type="text/javascript">
    tinyMCE.init({
        // General options
        mode: "exact",
        elements: "content",
        theme: "advanced",
        skin: "o2k7",
        skin_variant: "silver",
        language: "tr",
        plugins: "safari,pagebreak,style,layer,table,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,inlinepopups,simplebrowser",

        file_browser_callback: "openBrowser",
        plugin_simplebrowser_browselinkurl: 'tinymce/jscripts/tiny_mce/plugins/simplebrowser/browser.html?Connector=connectors/aspx/connector.aspx',
        plugin_simplebrowser_browseimageurl: 'tinymce/jscripts/tiny_mce/plugins/simplebrowser/browser.html?Type=Image&Connector=connectors/aspx/connector.aspx',
        plugin_simplebrowser_browseflashurl: 'tinymce/jscripts/tiny_mce/plugins/simplebrowser/browser.html?Type=Flash&Connector=connectors/aspx/connector.aspx',

        // Theme options
        theme_advanced_buttons1: "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
        theme_advanced_buttons2: "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
        theme_advanced_buttons3: "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
        theme_advanced_buttons4: "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak",
        theme_advanced_toolbar_location: "top",
        theme_advanced_toolbar_align: "left",
        theme_advanced_statusbar_location: "bottom",

        // Example content CSS (should be your site CSS)
        content_css: "css/content.css",

        // Drop lists for link/image/media/template dialogs
        template_external_list_url: "lists/template_list.js",
        external_link_list_url: "lists/link_list.js",
        external_image_list_url: "lists/image_list.js",
        media_external_list_url: "lists/media_list.js",

        // Replace values for the template plugin
        template_replace_values: {
            username: "Some User",
            staffid: "991234"
        }
    });
    function openBrowser(field_name, url, type, win) {
        var connector = "/tinymce/jscripts/tiny_mce/plugins/simplebrowser/browser.html?Connector=connectors/aspx/connector.aspx";
        var enableAutoTypeSelection = true;

        var cType;
        simplebrowser_field = field_name;
        simplebrowser = win;

        switch (type) {
            case "image":
                cType = "Image";
                break;
            case "flash":
                cType = "Flash";
                break;
            case "file":
                cType = "File";
                break;
        }

        if (enableAutoTypeSelection && cType) {
            connector += "&Type=" + cType;
        }

        window.open(connector, "simplebrowser", "modal,width=600,height=400");
    };
    function submitForm() {
        if (contentValidate()) {
            document.forms[0].submit();
        }
    }
    $(function() {
        $("#sDate").datepicker({ dateFormat: 'dd.mm.yy' });
        $("#fDate").datepicker({ dateFormat: 'dd.mm.yy' });
    });
    $(function() {
        $('#createFolder').click(function() {
            var folder = $('#folder').val();
            var archiveFolder = $('#ddlArchive :selected').val();

            $.getJSON('/content/createFolder/?folder=' + folder + '&archiveFolder=' + archiveFolder, null, function(data) {
                alert('Dosya yaratıldı.');
            });
        });
    });
    function descriptionMaxLength(object, maxLen) {
        return (object.value.length <= maxLen);
    }
</script>

</asp:Content>
